home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 493 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  48 lines

  1. Path: news.iastate.edu!usenet
  2. From: Mark Vellinga <vellinga@nwciowa.edu>
  3. Newsgroups: comp.lang.c++
  4. Subject: Turbo C++ and Printing in Win and Win95
  5. Date: 4 Jan 1996 20:35:01 GMT
  6. Organization: Northwestern College
  7. Message-ID: <4chdll$f87@news.iastate.edu>
  8. NNTP-Posting-Host: markv.nwciowa.edu
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  13.  
  14. I cannot print the output of my program from Turbo C++ 4.5 to a 
  15. printer.  I wish to print the output to a network printer.  
  16. Please help.
  17.  
  18. Please send reply to me directly.
  19.  
  20. My program is listed below.
  21.  
  22. Thanks, 
  23. Mark
  24. vellinga@nwciowa.edu
  25.  
  26.  
  27. #include <iostream.h>
  28. #include <fstream.h>
  29.  
  30. ofstream fileout("prn:");
  31. void main()
  32. {
  33.   const float PI=3.1415926536;
  34.   float radius, area;
  35.  
  36.   cout<<"Please enter the radius of a circle: ";
  37.   cin>>radius;
  38.   cout=fileout;
  39.   area=PI*radius*radius;
  40.   cout<<endl<<endl;
  41.   cout<<"Given a radius of "<<radius<<", ";
  42.   cout<<"the area of the circle is "<<area<<".";
  43.   cout<<endl<<endl<<"Thanks for using this Program!!"<<endl;
  44. }
  45.  
  46.  
  47.  
  48.